/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package Login;

//~--- JDK imports ------------------------------------------------------------

import java.sql.*;

/**
 *
 * @author Bharath
 */
public class MySqlConnector
 {
    Connection con;

    // method to getconnection to database
    public Connection Connect() throws Exception {
        try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();

            // get the connection
            con = DriverManager.getConnection("jdbc:mysql://localhost:3306/scf", "root", "admin");
            System.out.println("Connection in 'MySqlConnector file' is " + con);
        }    // end of try
                catch (Exception e) {
            e.printStackTrace();
            System.out.println("caught at driver");
            System.out.println("JDBC driver con" + con);
        }    // end of catch

        return con;
    }
}
